
import store from "@/store";
import request from "../../utils/request";
export function A() {
    return request({
        url: 'admin/store/List',
        method: 'get'
    })
}
export function GetByImportanceKey(data) {
    return request({
        url: '/admin/store/GetByImportanceKey',
        method: 'get',
        params: data
    })
}
export function getlist(currentPage) {
    return request({
        url: 'admin/store/List',
        method: 'get',
        params: {
            page: currentPage
        }
    })
}

export function HostKey() {
    return request({
        url: '/admin/store/GetShopKey',
        method: 'get',
        params: {
            StoreId: getStoreId()
        }
    })
}

export function GetGoodsListByStoreId(page, StoreId) {
    return request({
        url: '/admin/store/GetGoodsListByStoreId',
        method: 'get',
        params: {
            page: page, StoreId: StoreId
        }
    })
}


export function AddStore(Store) {
    return request({
        url: '/admin/store/AddStore',
        method: 'post',
        data: Store
    })
}
export function batchDelete(ids) {
    return request({
        url: '/admin/store/batchDelete?ids=' + ids,
        method: 'delete'
    })
}
export function getStoreType() {
    return request({
        url: '/admin/store/getStoreType',
        method: 'get'
    })
}

export function updateStoreStatus(StoreId, status) {
    return request({
        url: '/admin/store/updateStoreStatus',
        method: 'put',
        params: { StoreId, status }
    })
}

export function updateStore(store) {
    return request({
        url: '/admin/store/updateStore',
        method: 'put',
        data: store
    })
}

export function setStoreId(StoreId) {
    localStorage.setItem("StoreId", StoreId)
}

export function getStoreId() {
    return localStorage.getItem("StoreId")
}

